// Allee and Scalera 2012 IO

// Load original dataset
clear
use "AS2012 IO Rep Data.dta"

//REPLICATION
summarize
display c(k)
mdesc
sort uncode year
codebook uncode
codebook year

//Model 4.1
reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 member yr*, cluster (uncode)
codebook year if e(sample)
codebook uncode if e(sample)
mdesc lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 member yr*

//Model 4.2
reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memce rigorous yr*, cluster (uncode)
codebook year if e(sample)
codebook uncode if e(sample)
mdesc lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memce rigorous yr*

//Model 4.3
reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memre colonial yr*, cluster (uncode)
codebook year if e(sample)
codebook uncode if e(sample)
mdesc lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memre colonial yr*

//Model 4.4
reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memrc earlymem yr*, cluster (uncode)
codebook year if e(sample)
codebook uncode if e(sample)
mdesc lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memrc earlymem yr*

//Model 4.5
reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 rigorous colonial earlymem yr*, cluster (uncode)
codebook year if e(sample)
codebook uncode if e(sample)
mdesc lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 rigorous colonial earlymem yr*

//Model 4.6
reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 rigorous rigorouscounter colonial colonialcounter earlymem earlymemcounter yr*, cluster (uncode)
codebook year if e(sample)
codebook uncode if e(sample)
mdesc lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 rigorous rigorouscounter colonial colonialcounter earlymem earlymemcounter yr*

// IMPUTATION
clear
use "AS2012 IO Imp Data.dta"
summarize

mi import flong, m(imp) id(uncode year) imp(lnFtrade-yr08)

//Model 4.1
mi estimate, post: reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 member yr*, cluster (uncode)

//Model 4.2
mi estimate, post:reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memce rigorous yr*, cluster (uncode)

//Model 4.3
mi estimate, post: reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memre colonial yr*, cluster (uncode)

//Model 4.4
mi estimate, post:  reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 memrc earlymem yr*, cluster (uncode)

//Model 4.5
mi estimate, post:  reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 rigorous colonial earlymem yr*, cluster (uncode)

//Model 4.6
mi estimate, post: reg lnFtrade lnpop1 gled_gdppc totalcont polity domestic1_9 rigorous rigorouscounter colonial colonialcounter earlymem earlymemcounter yr*, cluster (uncode)
